Optimal. Leaf size=119 \[ \frac{2 i a b \text{PolyLog}\left (2,-e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d^2}+a^2 x-\frac{4 a b \sqrt{x} \log \left (1+e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d}+2 i a b x+\frac{2 b^2 \log \left (\cos \left (c+d \sqrt{x}\right )\right )}{d^2}+\frac{2 b^2 \sqrt{x} \tan \left (c+d \sqrt{x}\right )}{d}-b^2 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.176802, antiderivative size = 119, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 9, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.562, Rules used = {3739, 3722, 3719, 2190, 2279, 2391, 3720, 3475, 30} \[ a^2 x+\frac{2 i a b \text{Li}_2\left (-e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d^2}-\frac{4 a b \sqrt{x} \log \left (1+e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d}+2 i a b x+\frac{2 b^2 \log \left (\cos \left (c+d \sqrt{x}\right )\right )}{d^2}+\frac{2 b^2 \sqrt{x} \tan \left (c+d \sqrt{x}\right )}{d}-b^2 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3739
Rule 3722
Rule 3719
Rule 2190
Rule 2279
Rule 2391
Rule 3720
Rule 3475
Rule 30
Rubi steps
\begin{align*} \int \left (a+b \tan \left (c+d \sqrt{x}\right )\right )^2 \, dx &=2 \operatorname{Subst}\left (\int x (a+b \tan (c+d x))^2 \, dx,x,\sqrt{x}\right )\\ &=2 \operatorname{Subst}\left (\int \left (a^2 x+2 a b x \tan (c+d x)+b^2 x \tan ^2(c+d x)\right ) \, dx,x,\sqrt{x}\right )\\ &=a^2 x+(4 a b) \operatorname{Subst}\left (\int x \tan (c+d x) \, dx,x,\sqrt{x}\right )+\left (2 b^2\right ) \operatorname{Subst}\left (\int x \tan ^2(c+d x) \, dx,x,\sqrt{x}\right )\\ &=a^2 x+2 i a b x+\frac{2 b^2 \sqrt{x} \tan \left (c+d \sqrt{x}\right )}{d}-(8 i a b) \operatorname{Subst}\left (\int \frac{e^{2 i (c+d x)} x}{1+e^{2 i (c+d x)}} \, dx,x,\sqrt{x}\right )-\left (2 b^2\right ) \operatorname{Subst}\left (\int x \, dx,x,\sqrt{x}\right )-\frac{\left (2 b^2\right ) \operatorname{Subst}\left (\int \tan (c+d x) \, dx,x,\sqrt{x}\right )}{d}\\ &=a^2 x+2 i a b x-b^2 x-\frac{4 a b \sqrt{x} \log \left (1+e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d}+\frac{2 b^2 \log \left (\cos \left (c+d \sqrt{x}\right )\right )}{d^2}+\frac{2 b^2 \sqrt{x} \tan \left (c+d \sqrt{x}\right )}{d}+\frac{(4 a b) \operatorname{Subst}\left (\int \log \left (1+e^{2 i (c+d x)}\right ) \, dx,x,\sqrt{x}\right )}{d}\\ &=a^2 x+2 i a b x-b^2 x-\frac{4 a b \sqrt{x} \log \left (1+e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d}+\frac{2 b^2 \log \left (\cos \left (c+d \sqrt{x}\right )\right )}{d^2}+\frac{2 b^2 \sqrt{x} \tan \left (c+d \sqrt{x}\right )}{d}-\frac{(2 i a b) \operatorname{Subst}\left (\int \frac{\log (1+x)}{x} \, dx,x,e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d^2}\\ &=a^2 x+2 i a b x-b^2 x-\frac{4 a b \sqrt{x} \log \left (1+e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d}+\frac{2 b^2 \log \left (\cos \left (c+d \sqrt{x}\right )\right )}{d^2}+\frac{2 i a b \text{Li}_2\left (-e^{2 i \left (c+d \sqrt{x}\right )}\right )}{d^2}+\frac{2 b^2 \sqrt{x} \tan \left (c+d \sqrt{x}\right )}{d}\\ \end{align*}
Mathematica [B] time = 6.28, size = 308, normalized size = 2.59 \[ -\frac{2 a b \csc (c) \sec (c) \left (d^2 x e^{-i \tan ^{-1}(\cot (c))}-\frac{\cot (c) \left (i \text{PolyLog}\left (2,e^{2 i \left (d \sqrt{x}-\tan ^{-1}(\cot (c))\right )}\right )+i d \sqrt{x} \left (-2 \tan ^{-1}(\cot (c))-\pi \right )-2 \left (d \sqrt{x}-\tan ^{-1}(\cot (c))\right ) \log \left (1-e^{2 i \left (d \sqrt{x}-\tan ^{-1}(\cot (c))\right )}\right )-2 \tan ^{-1}(\cot (c)) \log \left (\sin \left (d \sqrt{x}-\tan ^{-1}(\cot (c))\right )\right )-\pi \log \left (1+e^{-2 i d \sqrt{x}}\right )+\pi \log \left (\cos \left (d \sqrt{x}\right )\right )\right )}{\sqrt{\cot ^2(c)+1}}\right )}{d^2 \sqrt{\csc ^2(c) \left (\sin ^2(c)+\cos ^2(c)\right )}}+x \sec (c) \left (a^2 \cos (c)+2 a b \sin (c)-b^2 \cos (c)\right )+\frac{2 b^2 \sec (c) \left (d \sqrt{x} \sin (c)+\cos (c) \log \left (\cos (c) \cos \left (d \sqrt{x}\right )-\sin (c) \sin \left (d \sqrt{x}\right )\right )\right )}{d^2 \left (\sin ^2(c)+\cos ^2(c)\right )}+\frac{2 b^2 \sqrt{x} \sec (c) \sin \left (d \sqrt{x}\right ) \sec \left (c+d \sqrt{x}\right )}{d} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.215, size = 0, normalized size = 0. \begin{align*} \int \left ( a+b\tan \left ( c+d\sqrt{x} \right ) \right ) ^{2}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 2.30698, size = 676, normalized size = 5.68 \begin{align*} a^{2} x + \frac{4 \, b^{2} d \sqrt{x} +{\left (4 \, a b \cos \left (2 \, d \sqrt{x} + 2 \, c\right ) + 4 i \, a b \sin \left (2 \, d \sqrt{x} + 2 \, c\right ) + 4 \, a b\right )} \arctan \left (\sin \left (2 \, d \sqrt{x} - 2 \, c\right ), \cos \left (2 \, d \sqrt{x} - 2 \, c\right ) + 1\right ) \arctan \left (\sin \left (d \sqrt{x}\right ), \cos \left (d \sqrt{x}\right )\right ) +{\left (-2 i \, a b \cos \left (2 \, d \sqrt{x} + 2 \, c\right ) + 2 \, a b \sin \left (2 \, d \sqrt{x} + 2 \, c\right ) - 2 i \, a b\right )} \arctan \left (\sin \left (d \sqrt{x}\right ), \cos \left (d \sqrt{x}\right )\right ) \log \left (\cos \left (2 \, d \sqrt{x} - 2 \, c\right )^{2} + \sin \left (2 \, d \sqrt{x} - 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d \sqrt{x} - 2 \, c\right ) + 1\right ) -{\left ({\left (2 \, a b - i \, b^{2}\right )} d^{2} \cos \left (2 \, d \sqrt{x} + 2 \, c\right ) -{\left (-2 i \, a b - b^{2}\right )} d^{2} \sin \left (2 \, d \sqrt{x} + 2 \, c\right ) +{\left (2 \, a b - i \, b^{2}\right )} d^{2}\right )} x +{\left (2 \, b^{2} \cos \left (2 \, d \sqrt{x} + 2 \, c\right ) + 2 i \, b^{2} \sin \left (2 \, d \sqrt{x} + 2 \, c\right ) + 2 \, b^{2}\right )} \arctan \left (\sin \left (2 \, d \sqrt{x}\right ) + \sin \left (2 \, c\right ), \cos \left (2 \, d \sqrt{x}\right ) + \cos \left (2 \, c\right )\right ) -{\left (2 \, a b \cos \left (2 \, d \sqrt{x} + 2 \, c\right ) + 2 i \, a b \sin \left (2 \, d \sqrt{x} + 2 \, c\right ) + 2 \, a b\right )}{\rm Li}_2\left (-e^{\left (2 i \, d \sqrt{x} - 2 i \, c\right )}\right ) +{\left (-i \, b^{2} \cos \left (2 \, d \sqrt{x} + 2 \, c\right ) + b^{2} \sin \left (2 \, d \sqrt{x} + 2 \, c\right ) - i \, b^{2}\right )} \log \left (\cos \left (2 \, d \sqrt{x}\right )^{2} + 2 \, \cos \left (2 \, d \sqrt{x}\right ) \cos \left (2 \, c\right ) + \cos \left (2 \, c\right )^{2} + \sin \left (2 \, d \sqrt{x}\right )^{2} + 2 \, \sin \left (2 \, d \sqrt{x}\right ) \sin \left (2 \, c\right ) + \sin \left (2 \, c\right )^{2}\right )}{-i \, d^{2} \cos \left (2 \, d \sqrt{x} + 2 \, c\right ) + d^{2} \sin \left (2 \, d \sqrt{x} + 2 \, c\right ) - i \, d^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.7668, size = 527, normalized size = 4.43 \begin{align*} \frac{2 \, b^{2} d \sqrt{x} \tan \left (d \sqrt{x} + c\right ) +{\left (a^{2} - b^{2}\right )} d^{2} x - i \, a b{\rm Li}_2\left (\frac{2 \,{\left (i \, \tan \left (d \sqrt{x} + c\right ) - 1\right )}}{\tan \left (d \sqrt{x} + c\right )^{2} + 1} + 1\right ) + i \, a b{\rm Li}_2\left (\frac{2 \,{\left (-i \, \tan \left (d \sqrt{x} + c\right ) - 1\right )}}{\tan \left (d \sqrt{x} + c\right )^{2} + 1} + 1\right ) -{\left (2 \, a b d \sqrt{x} - b^{2}\right )} \log \left (-\frac{2 \,{\left (i \, \tan \left (d \sqrt{x} + c\right ) - 1\right )}}{\tan \left (d \sqrt{x} + c\right )^{2} + 1}\right ) -{\left (2 \, a b d \sqrt{x} - b^{2}\right )} \log \left (-\frac{2 \,{\left (-i \, \tan \left (d \sqrt{x} + c\right ) - 1\right )}}{\tan \left (d \sqrt{x} + c\right )^{2} + 1}\right )}{d^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan{\left (c + d \sqrt{x} \right )}\right )^{2}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \tan \left (d \sqrt{x} + c\right ) + a\right )}^{2}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]